# -*- coding: utf-8 -*-
# @Time    : 2020/6/19 1:13
# @Author  : dearMrYang
# @File    : form.py
# @Software: PyCharm
from django import forms
from apps.form import FormMixin
from apps.news.models import News, Focus


class WriteNewsForm(forms.ModelForm, FormMixin):
    category = forms.IntegerField()

    class Meta:
        model = News
        exclude = ['author', 'category', 'pub_time']


class AddFocusForm(forms.ModelForm, FormMixin):
    class Meta:
        model = Focus
        fields = ('thumbnail', 'link_to', 'desc', 'priority')


class EditFocusForm(forms.ModelForm, FormMixin):
    focus_id = forms.IntegerField()

    class Meta:
        model = Focus
        fields = ('thumbnail', 'link_to', 'desc', 'priority', 'focus_id')
